﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using PostSharp.Laos;

namespace ConsolePostSharp
{
    [Serializable]
    [AttributeUsage(AttributeTargets.All, Inherited = true, AllowMultiple = false)]
    public class ExceptionAttribute : OnExceptionAspect
    {
        public override void OnException(MethodExecutionEventArgs eventArgs)
        {
            Console.WriteLine("程序出现异常：{0}", eventArgs.Exception.Message);
            eventArgs.FlowBehavior = FlowBehavior.Return;
        }
    }
}
